{template 'common/header'}
<div class="main">
    <ul class="nav nav-tabs">
        <li{if $_GPC['do'] == 'manager' || empty($_GPC['do'])} class="active"{/if}><a href="{php echo $this->createWebUrl('manager');}">喜帖管理</a>
        <li{if $_GPC['do'] == 'add'} class="active"{/if}><a href="{php echo $this->createWebUrl('add');}">添加喜帖</a></li>
    </ul>
    <div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="lxy_marry" />
                <input type="hidden" name="do" value="manager" />
                <input type="hidden" name="sid" value="{$sid}" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">新郎/新娘姓名</label>
                    <div class="col-xs-12 col-sm-7 col-lg-8">
                          <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
                    </div>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="panel panel-default">
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead class="navbar-inner">
				<tr>
					<th style="width:150px;">标题</th>
					<th style="width:200px;">新郎/新娘</th>
					<th style="width:200px;">婚礼日期</th>
					<th style="width:100px;">密码</th>
					<th style="width:150px;">操作</th>
				</tr>
				</thead>
				<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['title']}</td>
					<td>{php echo $item['xl_name'].'/'.$item['xn_name']}</td>
					<td>{$item['hy_time']}</td>
					<td>{$item['pwd']}</td>
					<td>
						<a class='btn btn-default btn-sm' href="{php echo $this->createWebUrl('infolist', array('sid' => $item['id']))}" data-toggle="tooltip" data-placement="bottom" title="查看赴宴信息及收到祝福"><i class="fa fa-search"></i></a>
						<a class='btn btn-default btn-sm'  href="{php echo $this->createWebUrl('add', array('id' => $item['id']))}" data-toggle="tooltip" data-placement="bottom" title="编辑"><i class="fa fa-edit"></i></a>
						<a class='btn btn-default btn-sm'  onclick="return confirm('删除喜帖将删除所有关联赴宴及祝福记录，确认吗？');
                                                        return false;" href="{php echo $this->createWebUrl('delete', array('id' => $item['id']))}" data-toggle="tooltip" data-placement="bottom" title="删除"><i class="fa fa-times"></i></a>
					</td>
				</tr>
				{/loop}
				</tbody>
				<tr>
					<td colspan="5">
						<input name="token" type="hidden" value="{$_W['token']}" />
						<input type="submit" class="btn btn-primary" name="submit" value="提交" />
					</td>
				</tr>
			</table>
       </div>
    </div>
	{$pager}
</div>
<script>
	require(['bootstrap'],function(){
		$('.btn').tooltip();
	});
</script>